{% extends "template.html" %}

{% block title %}mtop{% endblock %}

{% block page_title %}Measurement: <a href="/mtop/monitor/{{ mon_id }}/">{{ mon_id }}</a> :: {{ mes_id }}{% endblock %}

{% block head_additions %}
    <script type="text/javascript" src="/static/swfobject.js"></script>
    <script type="text/javascript" src="/static/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() { 
	$("span.spoiler").hide();
	$('<a class="reveal">&nbsp;&nbsp;(Click to show)</a>').insertBefore('.spoiler');
	$("a.reveal").click(function(){
		$(this).parents("p").children("span.spoiler").fadeIn(2500);
		$(this).parents("p").children("a.reveal").fadeOut(600);
	});
});

</script>
{% endblock %}

{% block sidebar_search %}{% endblock %}

{% block sidebar_additions %}
					<li><a href="/mtop/monitor/{{ mon_id }}/" title="Home">Go to monitor view</a></li>
{% endblock %}

{% block body %}
<br>
<font size=-2>Monitor id: <b><a href="/mtop/monitor/{{ mon_id }}/" title="Click to return to monitor view">{{ mon_id }}</a></b><br>
	<br>
    
    <p>
    
    {% for measurement in measurements %}
        {{measurement.name}} <font color=#6060B0>(Max = {{measurement.max_value}})</font> :<br>
        <br>
        {# <img src={{measurement.mgchart_url}}></img> #}
        <span class="chart" id="{{measurement.name}}"></span><br>
        <font color="#909090">{{measurement.csv}}</font>
        
        <script type="text/javascript">
        swfobject.embedSWF(
          "/static/open-flash-chart.swf", "{{measurement.name}}",
          "600", "200", "9.0.0", "/static/expressInstall.swf",
          {"data-file":"/data?data={{measurement.csv}}%26max={{measurement.max_value}}%26title={{measurement.name}}%26cri=12.6"} );
    	</script>
        
        <br>
        <br>
        <br>
    {% endfor %}
    </p>
    
{% comment %}
    <p>
	Triggers defined for this monitor:
    <blockquote><pre>
    {% for trigger in thresholds %}{{trigger}}
    {% endfor %}</pre></blockquote>
	</p>
    
    <br>

    <p> 
    Monitor's properties:<span class="spoiler"> 
    <blockquote><pre>
{{definition}}    
    </pre></blockquote>
	</span>
	</p>
{% endcomment %}
</font>
{% endblock %}
